package top.z.work.module.system.controller.config.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

@Data
@Accessors(chain = true)
@Schema(description = "系统管理 - 创建配置数据 VO")
public class SystemConfigCreateVO {

    @Length(min = 1, max = 50, message = "配置名称长度只能在2到50个字符之间")
    @NotBlank(message = "配置名称不能为空")
    @Schema(description = "配置名称", example = "测试开关")
    private String name;

    @Length(min = 1, max = 50, message = "配置键长度只能在2到50个字符之间")
    @NotBlank(message = "配置键不能为空")
    @Schema(description = "配置键", example = "test")
    private String code;

    @Length(min = 1, max = 200, message = "配置值长度只能在1到200个字符之间")
    @NotBlank(message = "配置值不能为空")
    @Schema(description = "配置值", example = "true")
    private String value;

    @Min(value = 0, message = "数据排序只能是 0 或者 99999 之间的数字")
    @Max(value = 99999, message = "数据排序只能是 0 或者 99999 之间的数字")
    @NotNull(message = "数据排序不能为空")
    @Schema(description = "数据排序", example = "1")
    private Integer sort;

}
